﻿<phone:PhoneApplicationPage 
    x:Class="ConfApp.Views.SpeakerDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Behaviours="clr-namespace:ConfApp.Infrastructure.Behaviours" xmlns:CustomControls="clr-namespace:Phone.Controls;assembly=Phone.Controls" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=SpeakerDetailsViewModel}"
    shell:SystemTray.IsVisible="True">

    <phone:PhoneApplicationPage.Resources>

        <!-- RESOURCES -->

        <!-- The group header template, for groups in the main list -->
        <DataTemplate x:Key="sessionGroupHeader">
            <Border Background="{StaticResource PhoneAccentBrush}" Padding="{StaticResource PhoneTouchTargetOverhang}">
                <TextBlock Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
            </Border>
        </DataTemplate>

        <!-- The template for groups when they are items in the "jump list". Not setting -->
        <!-- the GroupItemTemplate property will disable "jump list" functionality. -->
        <DataTemplate x:Key="groupItemHeader">
            <Border Background="{StaticResource PhoneAccentBrush}" Margin="{StaticResource PhoneTouchTargetOverhang}" Padding="{StaticResource PhoneTouchTargetOverhang}">
                <TextBlock Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
            </Border>
        </DataTemplate>

        <!-- The template for session items -->
        <DataTemplate x:Key="sessionItemTemplate">
            <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="3px"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Rectangle Grid.Column="0" Margin="-6,0,6,0" Fill="{Binding TrackColor}"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                <StackPanel Grid.Column="1" VerticalAlignment="Top">
                    <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextLargeStyle}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" TextWrapping="Wrap" Margin="12,-10,12,6"/>
                    <TextBlock Text="{Binding MinorInfo}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" Margin="12,3,0,9"  FontFamily="{StaticResource PhoneFontFamilyNormal}"/>
                    <TextBlock Text="{Binding Speakers}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" Margin="12,-30,12,9" FontFamily="{StaticResource PhoneFontFamilyNormal}"/>
                </StackPanel>
                <Custom:Interaction.Triggers>
                    <Custom:EventTrigger EventName="Tap">
                        <Custom:InvokeCommandAction Command="{Binding Path=DataContext.SessionSelectedCommand, ElementName=speakerSessions}" CommandParameter="{Binding}"/>
                    </Custom:EventTrigger>
                </Custom:Interaction.Triggers>
            </Grid>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
    
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="SINERGIJA 11">
            <!--Pivot item one-->
            <!--<controls:PivotItem Header="biografija">
                <StackPanel x:Name="ContentPanel" Margin="12,0,12,0">
                    <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Width="110" Height="150" Source="{Binding Picture}" VerticalAlignment="Top"/>
                        <StackPanel Grid.Column="1" VerticalAlignment="Top">
                            <TextBlock Text="{Binding FullName}" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="12,-12,12,6"/>
                            <TextBlock Text="{Binding Employer}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
                        </StackPanel>
                    </Grid>
                    <CustomControls:ScrollableTextBlock  
                            Text="{Binding Bio}"           
                            HorizontalAlignment="Left"   
                            VerticalAlignment="Top" 
                            Height="427" 
                            Width="421" 
                            Margin="12,0,0,0"
                             />

                </StackPanel>
            </controls:PivotItem>-->

            <controls:PivotItem Header="biografija">
                <StackPanel x:Name="ContentPanel" Margin="12,0,12,0">
                    <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Width="165" MaxHeight="225" Source="{Binding Picture}" VerticalAlignment="Top"/>
                        <StackPanel Grid.Column="1" VerticalAlignment="Top">
                            <TextBlock Text="{Binding FullName}" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="12,-12,12,6"/>
                            <TextBlock Text="{Binding Employer}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
                        </StackPanel>
                    </Grid>
                    <CustomControls:ScrollableTextBlock  
                            Text="{Binding Bio}"           
                            HorizontalAlignment="Left"   
                            VerticalAlignment="Top" 
                            Height="325" 
                            Width="421" 
                            Margin="12,0,0,0"
                             />

                </StackPanel>
            </controls:PivotItem>
            <!--Pivot item two-->
            <controls:PivotItem Header="predavanja">
                <toolkit:LongListSelector x:Name="speakerSessions" Background="Transparent"
                    ItemsSource="{Binding SpeakerSessionInfos}"                     
                    GroupHeaderTemplate="{StaticResource sessionGroupHeader}"
                    GroupItemTemplate="{StaticResource groupItemHeader}"
                    ItemTemplate="{StaticResource sessionItemTemplate}">                  
                </toolkit:LongListSelector>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>